<template>
  <div>
    <van-form @submit="onSubmit">
      <van-cell-group>
        <van-cell title="用户名：" />
        <van-field
          v-model="username"
          name="用户名"
          placeholder="请输入用户名"
          :rules="[{ required: true, message: '请填写用户名' }]"
        />
      </van-cell-group>
      <van-cell-group>
        <van-cell title="密码：" />
        <van-field
          v-model="password"
          type="password"
          name="密码"
          placeholder="请输入密码"
          :rules="[{ required: true, message: '请填写密码' }]"
        />
      </van-cell-group>

      <div style="margin: 16px">
        <van-button round block type="info" native-type="submit"
          >登录</van-button
        >
      </div>
    </van-form>
    <div style="margin: 16px">
      <van-button round block plain type="info">新用户注册</van-button>
    </div>
    <div class="login-bottom">
      <span>找回密码</span>
      ||
      <span>账号挂失</span>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      username: '',
      password: ''
    }
  },
  methods: {
    onSubmit(values) {
      console.log('submit', values)
    }
  }
}
</script>

<style lang="scss" scoped>
.login-bottom {
  margin: 0 auto;
  display: flex;
  justify-content: center;
}
</style>
